<?php

use swap\visitor;

class my_language_form_helper extends swap\helper {
    
    public static function run($context) {
        $resume_id = visitor::get_value('id');
        
        $show = false;
        $action = array('my-language/do_new', array('id' => $resume_id));
        $return_url = array('my-resume/edit', array('id' => $resume_id));
        
        if (isset($context['language'])) {
            $show = true;
            $action = array('my-language/do_edit', array('id' => $resume_id, 'language_id' => $context['language']->id));
            $return_url = array('my-language/index', array('id' => $resume_id, 'language_id' => $context['language']->id));
            
            self::set('language', $context['language']);
        }
        self::set('show', $show);
        self::set('action', $action);
        self::set('return_url', $return_url);
        
        self::render();
    }
    
}